package net.cyndeline.entitySystem.common

/**
 * An iterator that does nothing.
 */
class NullIterator[T >: Null <: AnyRef] extends Iterator[T] {
  override def hasNext = false
  override def next: T = null
  override def toIterator: Iterator[T] = this
  
  /* Used to compare results from tests. */
  override def equals(other: Any) = other match {
    case n: NullIterator[_] => true
    case _ => false
  }
}

object NullIterator {
  val instance = new NullIterator
}